package com.slkj.shilixiaoyuanapp.ui.find;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.entity.MyclassEntity;

import java.util.ArrayList;
import java.util.List;

public class MessageListAdapter extends BaseQuickAdapter<MyclassEntity ,BaseViewHolder> {

    private  List<MyclassEntity> picPaths = new ArrayList<>();
    private  Context context;
    private onDeleteLisener lisener;

    public void setLisener(onDeleteLisener lisener) {
        this.lisener = lisener;
    }

    public MessageListAdapter(@Nullable List<MyclassEntity> picPaths, Context context) {
        super(R.layout.item_circle_message, picPaths);
        this.context = context;
        this.picPaths = picPaths;
    }
    @Override
    protected void convert(BaseViewHolder helper, MyclassEntity item) {
        TextView message = helper.getView(R.id.tv_item_message);
        message.setText(item.getClassname());
        TextView btn = helper.getView(R.id.deleteBtn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                lisener.OnDelete();
            }
        });
    }
    public interface onDeleteLisener{
        void OnDelete();
    }
}
